<template>
  <div id="digital-flop">
    <div
      v-for="item in digitalFlopData"
      :key="item.title"
      class="digital-flop-item"
    >
      <div class="digital-flop-title">{{ item.title }}</div>
      <div class="digital-flop">
        <dv-digital-flop
          :config="item.number"
          style="width: 100%; height:50px"
        />
      </div>
    </div>

    <dv-decoration-10 :dur="10" />
  </div>
</template>

<script>
export default {
  name: 'DigitalFlop',
  data() {
    return {
      digitalFlopData: []
    }
  },
  mounted() {
    const { createData } = this

    createData()

    setInterval(createData, 30000)
  },
  methods: {
    createData() {
      this.digitalFlopData = [
        {
          'title': '出荷发票数',
          'number': {
            'number': [
              10
            ],
            'textAlign': 'center'
          }
        },
        {
          'title': '出荷个数',
          'number': {
            'number': [
              2500462
            ],
            'textAlign': 'center'
          }
        },
        {
          'title': '出荷箱数',
          'number': {
            'number': [
              958
            ],
            'textAlign': 'center'
          }
        },
        {
          'title': '卡板数',
          'number': {
            'number': [
              15
            ],
            'textAlign': 'center'
          }
        },
        {
          'title': '运输车辆',
          'number': {
            'number': [
              3
            ],
            'textAlign': 'center'
          }
        }
      ]
    }
  }
}
</script>

<style lang="less">
#digital-flop {
  position: relative;
  height: 13vh;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(6, 30, 93, 0.5);

  .dv-decoration-10 {
    position: absolute;
    width: 95%;
    left: 2.5%;
    height: 5px;
    bottom: 0px;
  }

  .digital-flop-item {
    width: 20%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-left: 3px solid rgb(6, 30, 93);
    border-right: 3px solid rgb(6, 30, 93);
  }

  .digital-flop-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .digital-flop {
    display: flex;
    width: 200px;
  }
}
</style>
